function writeShapeToFile(filename, shape)
fid = fopen(filename,'w');
if(fid==-1)
    disp('Can not create file!')
end

[y x] = size(shape)
for i = 1:y
    fprintf(fid,'%f %f \n', shape(i,1), shape(i,2));
end